package action;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class waitFor {

	public waitFor(WebDriver d) {
		this.d = d;
		wait = new WebDriverWait(d,config.cf_longTime);
	}
	
	
	public void waitForElement(WebDriver d, String element) {		
		WebElement e = d.findElement(By.xpath(element));
		wait.until(ExpectedConditions.visibilityOf(e));
	}
	
	public void waitForText(WebDriver d, String text) {		
		WebElement e = d.findElement(By.xpath("//.[contains(text(),'mail')]"));
		wait.until(ExpectedConditions.textToBePresentInElement(e, text));
	}
	
	WebDriver d = null;
	WebDriverWait wait = null;
}
